-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
legacyrpc: add address type arg to getNewAddress #783
Conversation
a8203b2
to
95e25c7
Compare
Updated |
ddd8553
to
bf285dc
Compare
bf285dc
to
aa9e9ba
Compare
7f67f28
to
896c627
Compare
896c627
to
1d1c003
Compare
Removed the temporary CI is bombing now because it started using go 1.18 and |
All still working as expected on my end after rebasing. Can get addresses of all three type and they validate as ismine. |
This slipped by, approved a CI run. |
Looks like I need to rebase. Also I'd fix up the change to |
1d1c003
to
6f4158e
Compare
Now that btcd 0.23 is tagged with rpcclient using btcsuite/btcd#1776, this PR will have to get merged before a new btcwallet release otherwise rpcclient will not be able to get new addresses from btcwallet. See btcsuite/btcd#1843 |
1b3229f
to
66ab03b
Compare
This handles the AddressType argument in the getNewAddress RPC handler. It recognizes "legacy", "p2sh-segwit", and "bech32" to match Bitcoin Core's RPC options. These correspond to bip44, bip49 "plus", and bip84. These are the waddrmgr.DefaultKeyScopes. The validateaddress RPC is already able to recognize these addresses, and it may be used to verify the addresses returned by getnewaddress. This adds btcjson.ErrRPCWalletInvalidAddressType with a code (-5) and message ("unknown address type") to match Bitcoin Core's v22.
66ab03b
to
186a4f9
Compare
Just retested with the following commands:
All working as expected. I had to update to neutrino 0.14.2 locally to build, but that is also done in #805 |
I'll pull this into #805 and give commit credit once the neutrino upgrade issue is resolved |
Replaced by #805 |
Resolves #646 and #762
Requires btcsuite/btcd#1776 (see thereplace
to my btcd repository that would be removed if that is merged). The btcctl from that branch would also be needed for testing this.This handles the
AddressType
argument in thegetNewAddress
andgetRawChangeAddress
RPC handlers. It recognizes "legacy", "p2sh-segwit", and "bech32" to match Bitcoin Core's RPC options. These correspond to the bip44, bip49 "plus", and bip84 paths. These are thewaddrmgr.DefaultKeyScopes
.The
validateaddress
RPC is already able to recognize these addresses, and it may be used to verify the addresses returned by bothgetnewaddress
andgetrawchangeaddress
.This adds
btcjson.ErrRPCWalletInvalidAddressType
with a code (-5) and message ("unknown address type") to match Bitcoin Core's v22.